﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace PInvokeTest
{
    public class UnsafenativeMethod
    {
        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern IntPtr CreatePerson();

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern int PersonEat(IntPtr value);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void PersonDelete(IntPtr value);
        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern IntPtr SetPersonAge(Person person,double age);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetPersonAge2(ref double person, double age);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetJob(Person person, Job job);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        internal static extern Byte someMethod(ref UInt32 mStatus);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetTeacher(Teacher person);
        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetTeacher(PureTeacher person);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetTeacherP(TeacherP person);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern IntPtr NewJoint();

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetJointLoad(IntPtr obj, NSJointLoad jointLoad);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern IntPtr GetJointLoad(IntPtr obj);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetJointLoadArr(IntPtr obj, int count, IntPtr[] jointLoad);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetJointStrArr(IntPtr obj, int count, [In, Out] string[] jointLoad);

        [DllImport(@"D:\2021\study\18_pinvoketest\x64\Debug\TestCore.dll")]
        internal static extern void SetJointSection(IntPtr obj, RectangleSection jointLoad);
    }
}
